﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;
using Abp.Domain.Entities.Auditing;

namespace FwProject.ShoppingMall.Shop
{
    /// <summary>
    /// 商品表
    /// </summary>
    [Table("ShopProduct")]
    public class ShopProduct: FullAuditedEntity<Guid>
    {


        public const int StringLength = 200;
        /// <summary>
        /// 商品分类id
        /// </summary>
        public Guid ShopTypeid { get; set; }

        /// <summary>
        /// 商品宣传图片
        /// </summary>
        [Required]
        [StringLength(StringLength)]
        public string ImagePic { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        [Required]
        [StringLength(StringLength)]
        public string ProductName { get; set; }
        /// <summary>
        /// 商品编号
        /// </summary>
        [Required]
        [StringLength(StringLength)]
        public string ProductNumber { get; set; }
        /// <summary>
        /// 市场价格
        /// </summary>
        [Required]
        public decimal MarketPrice { get; set; } = 0m;
        /// <summary>
        /// 商品介绍
        /// </summary>
        [Required]
        [StringLength(500)]
        public string ProductDetails { get; set; }
        /// <summary>
        /// 规格销售价
        /// </summary>
        [Required]
        public decimal SpcemarketPrice { get; set; } = 0m;
        /// <summary>
        /// 规格成本价
        /// </summary>
        [Required]
        public decimal SpcecostPrice { get; set; } = 0m;
        /// <summary>
        /// 重量
        /// </summary>
        [Required]
        public float SpceWeight { get; set; } = 0;
        /// <summary>
        /// 是否开启规格
        /// </summary>
        public bool SpceIsActive { get; set; } = false;
        /// <summary>
        /// 品牌id
        /// </summary>
        public Guid? Brandid { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        [StringLength(StringLength)]
        public string Unit { get; set; }
        /// <summary>
        /// 是否上架
        /// </summary>
        public bool IsGrounding { get; set; } = true;
        /// <summary>
        /// 供应商id
        /// </summary>
        public Guid ShopSupplierid { get; set; }
        /// <summary>
        /// 销售模式
        /// </summary>
        [Required]
        public ShopProductFlag ShopProductFlag { get; set; } = ShopProductFlag.正常;
    }
    public enum ShopProductFlag
    {
        [Display(Name = "正常")]
        正常=0,
        [Display(Name = "秒杀")]
        秒杀 =1,
        [Display(Name = "特价")]
        特价 =2,
        [Display(Name = "推荐")]
        推荐 =3
    }
}
